﻿<?xml version="1.0" encoding="utf-8" ?>
<CodeSnippets  xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
    <CodeSnippet Format="1.0.0">
        <Header>
            <Title>Define a task command with a can execute method for a view model class</Title>
            <Shortcut>vmtaskcommandwithcanexecute</Shortcut>
            <Description>Code snippet for a task command with a can execute method for a view model class</Description>
            <Author>CatenaLogic</Author>
            <SnippetTypes>
                <SnippetType>Expansion</SnippetType>
            </SnippetTypes>
        </Header>
        <Snippet>
            <Declarations>
                <Literal>
                    <ID>name</ID>
                    <ToolTip>Name of the command</ToolTip>
                    <Default>name</Default>
                </Literal>					
                <Literal>
                    <ID>type</ID>
                    <ToolTip>Type of the property</ToolTip>
                    <Default>type</Default>
                </Literal>
            </Declarations>
            <Code Language="csharp">
                <![CDATA[public TaskCommand $name$ { get; private set; }

// TODO: Move code below to constructor
$name$ = new TaskCommand(On$name$ExecuteAsync, On$name$CanExecute);
// TODO: Move code above to constructor

private bool On$name$CanExecute()
{
    return true;
}

private async Task On$name$ExecuteAsync()
{
    // TODO: Handle command logic here
}]]>
            </Code>
        </Snippet>
    </CodeSnippet>
</CodeSnippets>
